home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
Sherlock 2.0
/
SDEL
/
SDELsrc
/
sdel_init.c
< prev
next >
Wrap
Text File
|
1996-04-06
|
3KB
|
121 lines
/*
SDEL: initialization code
source: sdel_init.c
started: April 2, 1996.
version: April 6, 1996.
*/
// include these *before* Sherlock is included.
#include <Dialogs.h>
#include <Fonts.h>
#include <Menus.h>
#include <Quickdraw.h>
#include <OSEvents.h>
#include <Windows.h>
#include <LIBdialog.h>
#include <mac_gui.h>
#include "sdel.h"
#include "sdel_arg.h"
#include "sdel_init.h"
#include <LIBcmnd.h>
#include <LIBend.h>
#include <LIBenv.h>
#include <LIBlog.h>
#include <LIBobj.h>
// Private prototypes
static void event_call_back (void);
static void help (void);
// Initialize everything
void
init_all(void)
{
FTAG("init_all");
// Initialize the ToolBox
MaxApplZone();
MoreMasters();
MoreMasters();
MoreMasters();
MoreMasters();
MoreMasters();
InitGraf( (Ptr) &(qd.thePort));
InitFonts();
InitWindows();
InitMenus();
TEInit();
InitDialogs(0L);
FlushEvents(everyEvent,0);
InitCursor();
// Initialize the Sherlock window.
w_mac_init(
FALSE, /* Initialize the Macintosh ToolBox. */
TRUE, /* TRUE: output to Sherlock window. */
"SDEL LOG", /* Name of Sherlock window (if used). */
TRUE, /* TRUE: open Sherlock window. */
TRUE, /* TRUE: Insert standard menus. */
TRUE, /* TRUE: Insert Sherlock menu. */
TRUE, /* TRUE: Insert first item in apple menu. */
(pstring) "\pAbout SDEL...", /* Title of first item in apple menu. */
&about_dialog, /* CallBack routine for first apple item. */
TRUE, /* TRUE: Insert menus immediately. */
&event_call_back, /* Event callback routine. */
NULL, /* First user callback routine. */
(pstring) "\p", /* Name of first user menu item. */
NULL, /* Second user callback routine. */
(pstring) "\p", /* Name of second user menu item. */
NULL, /* Third user callback routine. */
(pstring) "\p" /* Name of third user menu item. */
);
// Initialize Sherlock.
SL_INIT();
// Process all arguments.
{
int argc = 0;
char ** argv = NULL;
init_args(&argc, &argv, lib_arg_file_name);
SL_PARSE(argc, argv, "++", "--");
/* Sherlock traces now in effect. */
arg_do_argv(argc, argv);
}
STATB(ftag);
/* Watch location 0. This test catches *p = x where p is NULL. */
SL_WATCH(0, 4, "loc 0");
/* Sign on _after_ opening the log file. */
ecnl(); es(lib_version); ecnl();
STATX(ftag);
}
// "Call-back" routine for event processing when Sherlock outputs a line.
static void
event_call_back(void)
{
SL_DISABLE();
if (w_applEvent(0) == FALSE) {
main_quit();
}
}